/*
 * DLList.cpp
 *
 *  Created on: Mar 29, 2013
 *      Author: tony
 */

#include <cstddef>
#include "DLNode.h"
#include "DLList.h"

#include <iostream>
using std::cout;
using std::endl;

namespace lab7 {

DLList::DLList() {
	first = NULL;
}

DLList::~DLList() {
	delete first;
}

void DLList::insert( int data ){
	DLNode* temp = first;
	first = new DLNode( data, first, NULL );
	if (temp == NULL)
		return;
	temp->setPrev( first );
}

void DLList::print(){
	DLNode* temp = first;
	while( temp != NULL ){
		cout << temp->getData() << " ";
		temp = temp->getNext();
	}
	cout << endl;

}

} /* namespace lab7 */
